﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace iemtm.WeChat.Core
{
    public static  class MemoryEntity
    {
        public static EntityBuff<string, Generator> gBuffGen = new EntityBuff<string, Generator>("DTUID");
        public static EntityBuff<string, Collector> cBuffColl = new EntityBuff<string, Collector>("DTUID");

        public static EntityBuff<int, WeixinConfig> gBuffWeiXinConfig = new EntityBuff<int, WeixinConfig>("Id");

        public static void init()
        {
            gBuffGen.UpdateFromDB();
            foreach (Generator g in gBuffGen.All.Values)
            {
                g.BOnline = true;
                g.bRunning = true;
            }
            cBuffColl.UpdateFromDB();
            foreach (Collector c in cBuffColl.All.Values)
            {
                c.BOnline = true;
                c.bRunning = true;
            }
            gBuffWeiXinConfig.UpdateFromDB();
        }
    }
}
